/**
 * 构建ztree树形
 */
function makeTree(url,divId,callback){	
	var setting = {
            data: {
            	key:{
					name:'name',
					url:'murl'
				},
                simpleData: {
                        enable: true,
                        idKey: "id",
                        pIdKey: "pid",
                        rootPId: 0
                }
            },
            async: { 
                    type: "post",
                    enable: true,
                    url:url
            },
            callback : {
                onClick: callback              
            }
    };
    $.fn.zTree.init($("#"+divId), setting);//初始化树对象a
}

/**
 * 构建ztree复选框树形
 * params 为参数构造的json对象
 */
function makeCheckTree(url,divId,params){
	var setting = {
            check: {
                    enable: true,
                    chkStyle: "checkbox",
                    chkboxType: { "Y" : "ps", "N" : "ps" }
            },
            data: {
                    simpleData: {
                            enable: true,
                            idKey: "id",
                            pIdKey: "pId",
                            rootPId: 0
                    }
            },
            async: { 
                    type: "post",
                    enable: true,
                    url: url,
                    otherParam: params
            }
    };
    $.fn.zTree.init($("#"+divId), setting);//初始化树对象a
}